﻿namespace SupportSystemUI.Controls.CustomPages.Crew
{
    using System.Windows.Controls;
    using SupportSystemDB;
    using SupportSystemUI.Controls.Utility.Other;

    /// <summary>
    /// Interaction logic for EventPage.xaml
    /// </summary>
    public partial class EventPage : UserControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="EventPage"/> class.
        /// </summary>
        /// <param name="eventData">Data of the displayed event.</param>
        public EventPage(Event eventData)
        {
            this.InitializeComponent();
            
            this.logoImage.SetImage(eventData.Logo);
            this.infoStack.Children.Add(new ListItem("Title", eventData.Name));
            this.infoStack.Children.Add(new ListItem("Start Date", eventData.StartDate.ToShortDateString()));
            this.infoStack.Children.Add(new ListItem("End Date", eventData.EndDate.ToShortDateString()));
            this.descriptionBlock.Text = eventData.Description;

            this.mainStack.Children.Add(new ViewMembersItem(eventData.Id));
        }
    }
}
